﻿// -----------------------------------------------------------------------
// <copyright file="FileInfoForm.cs" company="Abyssalsoft">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace Metal.CommonForms
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using Core.Player;

    /// <summary>
    /// File information window
    /// </summary>
    public partial class FileInfoForm : Form
    {
        /// <summary>
        /// Initializes a new instance of the FileInfoForm class.
        /// </summary>
        public FileInfoForm()
        {
            this.InitializeComponent();
        }

        /// <summary>
        /// Fill the text boxes
        /// </summary>
        /// <param name="sender">Object sender</param>
        /// <param name="e">Event args</param>
        private void FileInfoForm_Load(object sender, EventArgs e)
        {
            this.fieldAlbum.Text = MediaInfo.Album;
            this.fieldArtist.Text = MediaInfo.Artist;
            this.fieldTitle.Text = MediaInfo.Title;
            this.fieldComment.Text = MediaInfo.Comment;
            this.fieldGenre.Text = MediaInfo.Genre;
            this.fieldYear.Text = MediaInfo.Year;
            this.fieldTrack.Text = MediaInfo.Track;
            this.fieldBytes.Text = MediaInfo.BitRate;
            this.fieldFile.Text = MediaInfo.FilePath;
            this.fieldFrequency.Text = MediaInfo.Frequency;
            this.fieldChannel.Text = MediaInfo.Channel;
            this.fieldBytes.Text = MediaInfo.Bytes;

            // Video info
            this.fieldVideoSize.Text = MediaInfo.VideoSourceWidth.ToString() + " x " + MediaInfo.VideoSourceHeight.ToString();
            this.fieldVideoBitRate.Text = MediaInfo.VideoBitRate.ToString();
            this.fieldAverageTPF.Text = MediaInfo.AverageTimePerFrame.ToString();
        }

        /// <summary>
        /// Occurs when the user click OK button
        /// </summary>
        /// <param name="sender">Object sender</param>
        /// <param name="e">Event args</param>
        private void OkButton_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        /// <summary>
        /// Occurs when the user click Cancel button
        /// </summary>
        /// <param name="sender">Object sender</param>
        /// <param name="e">Event args</param>
        private void CancelButton_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
